#include "widget.h"

#include <QApplication>
#include <QApplication>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QVBoxLayout>
#include <QWidget>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    w.show();
    return a.exec();

    QApplication app(argc, argv);

    QWidget window;
    QVBoxLayout *layout = new QVBoxLayout(&window);

    QTreeWidget *treeWidget = new QTreeWidget();
    treeWidget->setColumnCount(3);
    treeWidget->setHeaderLabels(QStringList() << "Name" << "Size" << "Modified Date");
    treeWidget->setSortingEnabled(true); // 启用列排序

    // 添加根节点（文件夹）
    QTreeWidgetItem *rootItem = new QTreeWidgetItem(treeWidget);
    rootItem->setText(0, "Documents");

    // 添加子节点（文件）
    QTreeWidgetItem *childItem1 = new QTreeWidgetItem(rootItem);
    childItem1->setText(0, "Report.pdf");
    childItem1->setText(1, "1.2MB");
    childItem1->setText(2, "2023-10-01");

    QTreeWidgetItem *childItem2 = new QTreeWidgetItem(rootItem);
    childItem2->setText(0, "Presentation.pptx");
    childItem2->setText(1, "5.6MB");
    childItem2->setText(2, "2023-10-02");

    layout->addWidget(treeWidget);
    window.show();

    return app.exec();
}
